package entity

import (
	"time"
	"wms/pb"
)

// LogStock 出入库 日志
type LogStock struct {
	ID          int64             `gorm:"primaryKey;column:id;type:bigint;not null"`      // 日志id
	StockStatus pb.StockApplyType `gorm:"column:stock_status;type:tinyint"`               // 最近状态1入库2出库
	StockInID   int64             `gorm:"column:stock_in_id;type:bigint"`                 //
	StockInNo   string            `gorm:"column:stock_in_no;type:varchar(128)"`           //
	StockOutID  int64             `gorm:"column:stock_out_id;type:bigint"`                //
	StockOutNo  string            `gorm:"column:stock_out_no;type:varchar(128)"`          //
	Mac         string            `gorm:"column:mac;type:varchar(32)"`                    //
	Iccid       string            `gorm:"column:iccid;type:varchar(32)"`                  //
	SkuID       int64             `gorm:"column:sku_id;type:bigint"`                      //
	SkuCode     string            `gorm:"column:sku_code;type:varchar(32)"`               //
	WarehouseID int64             `gorm:"column:warehouse_id;type:bigint"`                // 仓库主键
	Reviewer    string            `gorm:"column:reviewer;type:varchar(64)"`               // 冗余
	StockInAt   *time.Time        `gorm:"column:stock_in_at;type:datetime;default:NULL"`  //
	StockOutAt  *time.Time        `gorm:"column:stock_out_at;type:datetime;default:NULL"` //
}

// TableName get sql table name.获取数据库表名
func (m *LogStock) TableName() string {
	return "log_stock"
}
